package com.example.projectmgmt.repository;

import com.example.projectmgmt.model.Project;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import java.util.List;

public interface ProjectRepository extends JpaRepository<Project, String> {

    @Query("SELECT p FROM Project p WHERE " +
            "p.projectNo LIKE %:keyword% OR " +
            "p.projectDesc LIKE %:keyword%")
    List<Project> findByProjectNoContainingOrProjectDescContaining(
            @Param("keyword") String keyword);
}